package com.hungtrung.game;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.hungtrung.entity.Ga;
import com.hungtrung.entity.GiaCam;
import com.hungtrung.entity.Ro;
import com.hungtrung.script.HungTrungScript;

public class HungTrungGame extends ApplicationAdapter {
	public static int WIDTH = 400;
	public static int HEIGHT = 600;
	SpriteBatch batch;
	Texture img;
	Ro ro;
	GiaCam ga, ngang;
	@Override
	public void create () {
		batch = new SpriteBatch();
		/*img = new Texture("badlogic.jpg");*/
		ro = new Ro(new Vector2(300, 50), new Vector2(0, 0));
		ga = new Ga(new Vector2(400-82, 600-82), new Vector2(0, 0));	
		
	}
	HungTrungScript script = new HungTrungScript();
	@Override
	public void render () {
		batch.begin();
		//Gdx.gl.glClearColor(1, 0, 0, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);			
		ga.render(batch);
		ga.update();		
		ro.render(batch);
		ro.update();
		script.themGiaCam(batch);
		batch.end();
		/*Gdx.gl.glClearColor(1, 0, 0, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		batch.begin();
		batch.draw(img, 0, 0);
		batch.end();*/
	}
	
	
}
